<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="myDiv">
        <div id="div1">1</div>
        <div id="div2">2</div>
        <div id="div3">3</div>
        <div id="div4">4</div>

    </div>
</body>
<script>
    console.log(document.getElementById("myDiv"));
    console.log(myDiv.firstElementChild); //<div id="div1">1</div>
    console.log(myDiv.firstElementChild.nextElementSibling); //  <div id="div2">2</div>
    console.log(myDiv.lastElementChild.previousElementSibling); //<div id="div3">3</div>
    console.log(myDiv.lastElementChild); //<div id="div4">4</div>
    console.log(myDiv.childElementCount); //4
    console.log(myDiv);
    console.log(myDiv.innerHTML); //<div id="div1">1</div>
    //<div id="div2">2</div>
    //<div id="div3">3</div>
    //<div id="div4">4</div>
    console.log(myDiv.textContent); //1 2 3 4
</script>

</html>